package pt.elvis.revanweb.client.DatabaseObjects;

import static com.google.gwt.user.client.Window.alert;

import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.Response;

public abstract class MyRequestCallback implements RequestCallback {
	@Override
	public void onError(Request request, Throwable exception) {
		alert(exception.getMessage());
	}

	@Override
	public void onResponseReceived(Request request, Response response) {
		onText(response.getText());
	}

	protected abstract void onText(String text);
}
